package com.kws.tool.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.kws.common.core.domain.R;
import com.kws.tool.dto.BizContent;
import com.kws.tool.service.InvoiceService;
import com.kws.tool.vo.InvoiceVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : zhangbenting
 * @date : 2024/11/11 19:01
 * @Version: 1.0
 */
@RequestMapping("/invoiceManage")
@RestController
@Api(value = "电子发票管理", tags = "电子发票管理")
public class InvoiceController {

    @Autowired
    private InvoiceService invoiceService;

    @PostMapping("/generateInvoice")
    @ApiOperation("生成电子发票")
    @ApiOperationSupport(order = 1, includeParameters = {
            "bizContent.kpddh"
    })
    public R<InvoiceVo> generateInvoice(@RequestBody BizContent bizContent) {
        return R.ok(invoiceService.generateInvoice(bizContent));
    }

}
